def toDell(code, driver, count, mode='buy'):

  # 点击搜索
  driver.find_element_by_id("search_iv").click()
  search_box = driver.find_element_by_id("et_search")

  # 输入代码
  search_box.send_keys(code[0])
  #点击代码
  driver.find_element_by_id("tv_name").click()

  # 点击交易按钮
  driver.find_element_by_id("dock_deal").click()

  # 点击闪电买入            # deal_thunder_sell
  driver.find_element_by_id("deal_thunder_"+mode).click()

  # 输入密码
  if count == 2:
    driver.find_element_by_id("password_tv").send_keys("061994")
    #登录
    driver.find_element_by_id("trade_login_btn").click()

  # 买入4分之一             # button_entrust_pay_1_2
  driver.find_element_by_id("button_entrust_pay_1_4").click()
  #确定买入                 # button_entrust_buy
  driver.find_element_by_id("button_entrust_buy").click()

  # 确认买入
  driver.find_element_by_id("tv_entrust").click()